package com.yuan.model_convenient.service;

import com.yuan.model_common.dto.CommonQueryCriteria;
import com.yuan.model_convenient.domain.ConvenientActivity;
import com.yuan.model_convenient.service.dto.ConvenientActivityDto;
import com.yuan.model_convenient.service.dto.ConvenientActivityQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface ConvenientActivityService {
    void download(List<ConvenientActivityDto> queryAll, HttpServletResponse response) throws IOException;

    PageResult<ConvenientActivityDto> queryAll(Pageable pageable);

    PageResult<ConvenientActivityDto> queryAll(CommonQueryCriteria criteria, Pageable pageable);

    PageResult<ConvenientActivityDto> queryAllByType(ConvenientActivityQueryCriteria criteria, Pageable pageable);

    @Transactional(rollbackFor = Exception.class)
    void create(ConvenientActivity resources);

    @Transactional(rollbackFor = Exception.class)
    void updatePersonNum(Integer activityId);

    @Transactional(rollbackFor = Exception.class)
    void update(ConvenientActivity resources) throws Exception;

    @Transactional(rollbackFor = Exception.class)
    void delete(Integer ids);
}
